﻿using System;
using System.Net;
using System.Windows;
using System.Windows.Controls;
using System.Windows.Documents;
using System.Windows.Ink;
using System.Windows.Input;
using System.Windows.Media;
using System.Windows.Media.Animation;
using System.Windows.Shapes;
using System.Collections.Generic;
using JeffWilcox.Utilities.Silverlight;
using System.Windows.Browser;
using System.Threading;
using System.IO;
using System.Text;
using System.Runtime.Serialization.Json;
using System.Reflection;
using VkApi.DataTypes;

namespace VkApi
{
    public partial class VkApi
    {
        /// <summary>
        /// Language_s the get values.
        /// </summary>
        /// <param name="app_id">The application ID.</param>
        /// <param name="sig">The signature. equals md5(viewer_idparam1=value1param2=value2secret)</param>
        /// <param name="v">The version of API. Current 2.0</param>
        /// <param name="language">The language ID. Current users language by default. (unnecessary)</param>
        /// <param name="keys">The keys array to translate. (unnecessary)</param>
        /// <param name="all">If = 1 will b returned all values. (unnecessary)</param>
        /// <param name="callback">The callback.</param>
        /// <returns>Pairs.</returns>
        /// <added_by>Anton Gubarenko</added_by>
        public long Language_GetValues(long app_id, string sig, string v, int? language, string[] keys, int? all, ApiCallback<Object> callback)
        {
            List<Parameter> list = new List<Parameter>();
            list.Add(new Parameter("app_id", app_id.ToString()));
            list.Add(new Parameter("sig", sig.ToString()));
            list.Add(new Parameter("v", v));        
            if (language != null) list.Add(new Parameter("language", language.ToString()));
            string keysString = "";
            foreach (string s in keys)
                keysString += s.Trim().ToString() + ",";
            keysString = keysString.Remove(keysString.Length - 1);
            list.Add(new Parameter("keys", keysString));
            if (all != null) list.Add(new Parameter("all", all.ToString()));

            return this.SendRequest("language.getValues", callback, list.ToArray());
        }

    }
}
